<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page language="java" import="java.util.*"%>
<%@page import="com.peycard.common.PortalUserDTO"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
	function desactivar(name) {
		var boton = document.getElementById(name);
		boton.disabled = true;
		return true;
	}
</script>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>PeyCard Teknei</title>
<link rel="stylesheet"
	href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700|Archivo+Narrow:400,700"
	type="text/css" />
<link rel="stylesheet" href="<%=basePath%>static/css/style.css"
	type="text/css" media="screen" />
</head>
<body>
	<div id="menu-wrapper">
		<div id="menu">
			<ul>

			</ul>
		</div>
	</div>
	<!-- end #menu -->
	<div id="header-wrapper">
		<div id="header">
			<div id="logo">
				<h1>
					<a href="#">PeyCard Teknei</a>
				</h1>
			</div>
		</div>
	</div>
	<div id="wrapper">
		<!-- end #header -->
		<div id="page">
			<div id="page-bgtop">
				<div id="page-bgbtm">

					<div id="content">
						<div class="post">
							<h2 class="title">
								<a href="#">Inicio de Sesi&oacute;n</a>
							</h2>
							<div style="clear: both;">&nbsp;</div>
							<div class="entry">
								<form method="post" name="f" class="signin"
									action="<%=basePath%>j_spring_security_check">
									<fieldset>
										<c:if test="${not empty requestScope['SESSION_EXP']}">
											<br />
											<span id="infomessage" class="errormessage"
												style='color: #ff0000;'> <c:out
													value="${requestScope.SESSION_EXP}" />.
											</span>
											<br />
										</c:if>
										<c:if test="${not empty param.login_error}">
											<br />
											<span id="infomessage" class="errormessage"> <c:set
													var="theString"
													value="${SPRING_SECURITY_LAST_EXCEPTION.message}" /> <c:choose>
													<c:when test="${fn:contains(theString, 'UserDetails')}">
                                                            Usuario o contraseña incorrecta.
                                                        </c:when>
													<c:when test="${fn:contains(theString, 'connection')}">
                                                            Error de conectividad, no se puede acceder al servicio.
                                                        </c:when>
													<c:otherwise>
                                                            Error general, no se puede acceder al servicio.
                                                        </c:otherwise>
												</c:choose> <!--No se puede accesar debido a: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>.-->
											</span>
											<br />
										</c:if>
										<c:if test="${not empty param.loggedout}">
											<br />
											<span id="infomessage" class="successmessage"> Has
												salido del sistema correctamente. </span>
											<br />
											<br />
										</c:if>
										<table cellspacing="0">
											<tr>
												<th><label for="username_or_email">Usuario</label></th>
												<td><input id="username_or_email" name="j_username"
													type="text" /></td>
											</tr>
											<tr>
												<th><label for="password">Password</label></th>
												<td><input id="password" name="j_password"
													type="password" /></td>
											</tr>
											<tr>
												<td><a href="recupera.jsp">Olvidé mi contraseña</a></td>
											</tr>
											<tr>
												<th></th>
												<td align="right"><input id="commit" type="submit"
													value="Ingresar" /></td>
											</tr>
										</table>
									</fieldset>
								</form>
							</div>
						</div>
						<div style="clear: both;">&nbsp;</div>
					</div>
					<!-- end #content -->
					<div style="clear: both;">&nbsp;</div>
				</div>
			</div>
		</div>
		<!-- end #page -->
	</div>
	<div id="footer">
		<p>
			&copy; 2013 PeyCard.com. | Design by <a href=#>Teknei</a>.
		</p>
	</div>
	<!-- end #footer -->
</body>
</html>
